package androidoll.com;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.WebView;

public class Androidoll extends Activity {
    /** Called when the activity is first created. */
	
	WebView mWebView;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    	Intent httpIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://androidoll.com/") );
    	startActivity(httpIntent);         
    }
    
//    public boolean onKeyDown(int keyCode, KeyEvent event) {
//        if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
//            mWebView.goBack();
//            return true;
//        }
//        return super.onKeyDown(keyCode, event);
//    }
    
    
//    private class HelloWebViewClient extends WebViewClient {
//        @Override
//        public boolean shouldOverrideUrlLoading(WebView view, String url) {
//        	
//        	if (url != null && url.startsWith("https://market.android.com/")) {
//        		String newUrl = url.replaceAll("https://market.android.com/", "market://");
//            	view.getContext().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(newUrl)));
//                return true;
//            } else {
//                return false;
//            }
//        }
//    }
    
    public boolean isOnline() {
    	 ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    	 return cm.getActiveNetworkInfo().isConnectedOrConnecting();

    }
    
    
}